package string;

public class LengthDemo {
    public static void main(String[] args) {
        String m = "你说得对，but，你";
        System.out.println(m.indexOf("，"));
        System.out.println(m.indexOf("，",5));
        System.out.println(m.indexOf("你",5));
        System.out.println(m.indexOf("你"));
//        System.out.println(m.charAt(0));
//        System.out.println(m.substring(0,9));
        String baidu = "www.baidu.com";
        String souhu = "www.souhu.cn";
        System.out.println(getHostName(baidu));
        System.out.println(getHostName(souhu));
    }
    public static  String getHostName(String n){
        return n.substring(n.indexOf(".")+1,n.indexOf(".",n.indexOf(".")+1));
    }
}
